package com.xwolf.test;

import lombok.extern.log4j.Log4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ming
 * @Description:
 * @create 2019-01-25 11:41 PM
 **/
@Log4j
public class MyApplication {
    public static void main(String... args){
        log.info("this is non-springboot project");
        log.info("-----------it is up----------");
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("springApplicationContext.xml");
        MyBean myBean = (MyBean)applicationContext.getBean("myBean");
        myBean.checkName();

        while (true){
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.info("I am alive!");
        }
    }
}
